////////////////////////////////////////////////////////////////////////////////
//(c) Intelliquip, Inc. 2001
////////////////////////////////////////////////////////////////////////////////
//$Log:
// 6    Version 10.0 (Current View)1.5         11/5/2010 1:05:31 PM   Stephen
//      Kish    IDD#6245: Refactoring changes
// 5    Version 10.0 (Current View)1.4         10/19/2010 2:26:32 PM  Stephen
//      Kish    IDD#6245: Refactoring HttpSessions.get and set Attribute to use
//      DAO classes
// 4    Version 10.0 (Current View)1.3         10/7/2010 4:52:11 PM   Jeff
//      Heigl      IDD#9126: new item servlet cleanup
// 3    Version 10.0 (Current View)1.2         9/29/2008 3:09:59 PM   Hai Hoang
//            IDD#7132: persisting userSettings across all apps
// 2    Version 10.0 (Current View)1.1         9/23/2008 8:50:09 AM   Hai Hoang
//            IDD#7180: persisting systemCurve settings
// 1    Version 10.0 (Current View)1.0         9/22/2008 3:16:28 PM   Jeff
//      Heigl      
//$
//$NoKeywords$
////////////////////////////////////////////////////////////////////////////////
package com.intelliquip.hydraulicselection.control.web;

import javax.servlet.http.HttpSession;

import com.intelliquip.core.servlet.SaveSettingsRedirectFilter;
import com.intelliquip.hydraulicselection.UserPreferences;

public class SaveSettingsRedirectFilterSelector extends SaveSettingsRedirectFilter {

	@Override
	protected void putUserSettingsIntoSettingHash(HttpSession session) throws Exception {
		cacheUserSettings(session);
	}

	public static void cacheUserSettings(HttpSession session) throws Exception {
		if (session != null) {
			SessionAttributeDAO_Selector dao = new HttpSessionAttributeDAO_Selector(session);
			UserPreferences userPreferences = dao.getUserPreferences();
			if (userPreferences != null) {
				userPreferences.putUserSettingsIntoSettingsHash();
			}
		}
	}

	@Override
	protected String getAppName() {
		return "SEL";
	}

	@Override
	protected String getIfeLogoutAndTimeoutURL(HttpSession session) {
		SessionAttributeDAO_Selector dao = new HttpSessionAttributeDAO_Selector(session);
		return dao.getIfeLogoutAndTimeoutURL();
	}
}
